package com.zhanggm.springboot.demo.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class TaskService {

    private Logger logger = LoggerFactory.getLogger(getClass());

    @Async
    public void task1() throws InterruptedException {
        Thread.sleep(50);
        logger.info("task1："+new Date());
    }
}
